import request from '@/utils/request'

// 上传视频
export function uploadVideoService(formData) {
  return request.post('/video/upload', formData, {
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

// 获取视频列表
export function getVideoListService(courseId) {
  return request.get('/video/list', {
    params: { courseId }
  })
}

// 更新视频
export function updateVideoService(formData) {
  return request.post('/video/update', formData, {
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}

// 删除视频
export function deleteVideoService(videoId) {
  return request.post('/video/delete', null, {
    params: { videoId }
  })
}

// 获取视频详情
export function getVideoDetailService(videoId) {
  return request.get(`/video/${videoId}`)
}